
export function	formatDate(dateStr) {
	
	    const str=dateStr.replace(/-/g,"")
			// 处理YYYYMMDD格式的日期
			if (typeof str === 'string' && str.length === 8){
				const year = str.slice(0, 4);
				const month = str.slice(4, 6);
				const day = str.slice(6, 8);
				return `${year}-${month}-${day}`;
			
			}
			const date = new Date(str);
			return `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')}`;
		}